package Java练习.面向对象综合练习.基础;

public class RoleText {
    public static void main(String[] args) {
        //创建乔峰角色
        Role r1 = new Role("乔峰", 100,'男');
        //创建鸠摩智
        Role r2 =new Role("九天玄女",100,'女');

        //创建对决场景
        while (true){
            r1.attack(r2);
            if(r2.getBlood()==0){
                System.out.println(r1.getName()+"打败了"+r2.getName());
                break;
            }
            r2.attack(r1);
            if(r1.getBlood()==0){
                System.out.println(r2.getName()+"打败了"+r1.getName());
                break;
            }
        }
        //显示角色信息
        r1.showRoleInfo();
        r2.showRoleInfo();
    }
}